Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: index out-of-bounds issue in the LT05 rule when trying to remove elements from a sequence #1038

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bradleyess
Copy link

When running sqruff on a DBT model in Snowflake dialect, the LT05 rule was panicking. This only removes the indexes when they exist, otherwise prints.

Error:

thread 'main' panicked at crates/lib/src/rules/layout/lt05.rs:166:21:
removal index (is 14) should be < len (is 10)

@benfdking
Copy link
Collaborator

Hey @bradleyess,

Thank you so much for your contribution. I am slightly worried about this in its current shape. We don't currently support the Jinja template and so I am not sure your test proves the fix: I think we skip the test for templates we don't have yet.

I am looking at the Jinja templater right now, so I can look into this after that having finished it.

If you can prove that this test fails without any jinja that could be really helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants